<?php

namespace app\common\service;


use think\Db;

class HostHardware extends BaseService
{
    /**
     * @name: 显示硬件信息
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-04-01 16:08:42
     */
    public function findOne ($host_id)
    {
        $return = Db::name('HostHardware')->field('info')->where('host_id', $host_id)->find();

        return $return;
    }

    /**
     * @name: 添加端口
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-11-07 14:30:04
     */
    public function add ($host_id)
    {
        return Db::name('HostHardware')->insert(['host_id' => $host_id,'info'=>'']);
    }

    /**
     * @name: 修改
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-11-15 15:39:46
     */
    public function modify($host_id, $info)
    {
        Db::name('HostHardware')->where('host_id', $host_id)->update(['info' => $info]);
    }
}